import request from "@/request/request.js"

// 获取验证码
export const getSendCode = (params) => {
	return request({
		url:`/fwechat/sendCode?phone=${params}`,
		method:'get',
	})
}
// 验证码登录
export const postLoginByCode = (params) => {
	return request({
		url:`/fwechat/loginByCode`,
		method:'post',
		data:params
	})
}

// 设备列表
// export const getDeviceQuery = (params) => {
// 	return request({
// 		url:`/front/device/query`,
// 		method:'get'
// 	})
// }

// 查询设备
export const getFindDeviceByUid = (params)=>{
	return request({
		url:`/front/device/findDeviceByUid`,
		method:'get',
		data:params
	})
}

// 添加设备
export const getAddDevice = (params) => {
	return request({
		url:`/front/device/addDevice`,
		method:'post',
		data: params
	})
}

// 低电量提醒
export const getCheckBattery = (params) => {
	return request({
		url:`/front/device/checkBattery?uid=${params}`,
		method:'get'
	})
}


// 获取录音
export const getFfileQuery = (params) => {
	return request({
		url:`/ffile/query`,
		method:'get',
		data:params
	})
}

// 修改录音名称
export const putUpdate = (data) => {
	return request({
		url: `/ffile/update?id=${data.id}&name=${data.name}`,
		method: 'put',
	})
}

// 检查单个的录音
export const findFileById = (id) => {
	return request({
		url: `/ffile/findFileById?id=${id}`,
		method: 'get'
	})
}

// 修改个人信息
export const putUserInfo  = (params) => {
	return request({
		url:`/fwechat/update?${params}`,
		method:'put',
	})
}


// 退出登录
export const postLogOut = (userId) => {
	return request({
		url:`/fwechat/logout?userId=${userId}`,
		method:'post'
	})
}

//获取省份
export const getProvince = () => {
	return request({
		url:'/region/getProvince',
		method:'get'
	})
}

//获取城市
export const getCity = (pid) => {
	return request({
		url:`/region/getCity?pid=${pid}`,
		method:'get'
	})
}
//获取城市
export const postBind = (data) => {
	return request({
		url:`/front/device/new`,
		method:'post',
		data
	})
}
export const getdata = (pid) => {
	return request({
		url:`/front/device/findDeviceByUid?uid=${pid}`,
		method:'get'
	})
}
